<%--
  Created by IntelliJ IDEA.
  User: zzf
  Date: 2021/1/10
  Time: 14:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
  <head>
    <title>首页</title>
    <script src="${pageContext.request.contextPath}/script/jquery-1.7.2.js"></script>
    <script type="text/javascript">
      $(function (){
        $("#btn01").click(function (){
          $.ajax({
            "url":"${pageContext.request.contextPath}/ajax/test/one",
            "type":"post",
            "data":{
              "userName":"tom",
              "userPwd":"123456"
            },
            "dataType":"text",
            "success":function (response){
              console.log(response);
            },
            "error":function (response){
              console.log(response);
            }
          })
        })
      })
    </script>
  </head>
  <body>
  <a href="${pageContext.request.contextPath}/emp/list" >显示员工列表</a>

  <form action="${pageContext.request.contextPath}/test/upload"
        method="post"
        enctype="multipart/form-data">
    用户名：<input type="text" name="username" value="张三"/>
    头像: <input type="file" name="picture"/><br>
    <button type="submit">上传</button>
  </form>
  <br>
  <button id="btn01">请求</button>
  </body>
</html>
